<?php include('header.php');?>
<script type="text/javascript"> 
$(function() {
	var dates = $( "#CheckIn, #CheckOut" ).datepicker({
			isBuddhist : true,
  			dateFormat: 'dd/mm/yy',
  			changeMonth: true,
  			autoSize: true,
  			minDate: 0,
  			showButtonPanel: true,
  			numberOfMonths: 2,

		onSelect: function( selectedDate ) {
			var option = this.id == "CheckIn" ? "minDate" : "maxDate",
				instance = $( this ).data( "datepicker" ),
				date = $.datepicker.parseDate(
					instance.settings.dateFormat ||
					$.datepicker._defaults.dateFormat,
					selectedDate, instance.settings );
			dates.not( this ).datepicker( "option", option, date );
		}
	});
});

function checktext(){
	if(document.frmMain.CheckIn.value == ""){
		alert('กรุณาเลือกวันที่ Check In ด้วยค่ะ');
		document.frmMain.CheckIn.focus();
		return false;	
	}

	if(document.frmMain.CheckOut.value == ""){
		alert('กรุณาเลือกวันที่ Check Out ด้วยค่ะ');
		document.frmMain.CheckOut.focus();
		return false;	
	}
	
	doCallAjax(document.getElementById('CheckIn').value,document.getElementById('CheckOut').value);
	
}


</script>
<style type="text/css">
.overmouse{
	background-color: #1BE059;
	cursor:pointer;
}
</style>
<body>

<div class="box">
  <div class="left"></div>
  <div class="right"></div>
    <div class="heading"><h1>เช็คสถานะห้องพัก</h1>
        <div class="buttons">
    <form name="frmMain">
    <label for="CheckIn">Check In</label>
<input type="text" id="CheckIn" name="CheckIn" readonly="readonly" onclick="datenext(this.value);"/>
<label for="to">Check Out</label>
<input type="text" id="CheckOut" name="CheckOut" readonly="readonly" />
<input type="hidden" id="CheckInToday" name="CheckInToday" value="<?php echo date("d/m/Y");?>" />
<input type="hidden" id="CheckOutToday" name="CheckOutToday" value="<?php echo date("d/m/Y", strtotime("+1 day"));?>" />
<a class="button" onclick="checktext();"><span>เช็คสถานะห้องพัก</span></a>
</form></div></div>
  <div class="content">
<span id="mySpan"></span>

  </div>
</div>
</body>
<?php include('footer.php');?>
